package net.omnivention.wulumuqi.html;

import java.util.List;

import net.omnivention.wulumuqi.WuluUtil;

import org.jaxen.JaxenException;
import org.jdom.Element;
import org.jdom.JDOMException;
import org.jdom.xpath.XPath;

/**
 * A ContainerElement is an HTML element that can contain children elements
 * @author son
 *
 */
class ContainerElement extends Element {
	public ContainerElement(String name) {
		super(name);
	}

	public Element selectNode(String xpathExpression) throws JaxenException, JDOMException {
		XPath xpath = WuluUtil.createXPath(xpathExpression);
		return (Element) xpath.selectSingleNode(this);
	}

	public List selectNodes(String xpathExpression) throws JaxenException, JDOMException {
		XPath xpath = WuluUtil.createXPath(xpathExpression);
		return xpath.selectNodes(this);
	}
}
